<script setup lang="ts">
import { ref, onMounted } from 'vue'
import dayjs from 'dayjs'
import { getScreenDeviceInfo,getScreenExaminationRoomTimesDeviceList } from '@/api/fortyThree'
import { useRouter } from 'vue-router'
import LogOut from "@/components/LogOut.vue";
const router = useRouter()
const id = router.currentRoute.value.query.id as string
// 装置信息
const deviceInfo = ref<any>({})
const _getScreenDeviceInfo = ()=>{
  getScreenDeviceInfo().then(res => {
    if (res.code === 200) {
      deviceInfo.value = res.data
    }
  })
}
// 比赛信息
const gameList = ref<any[]>([])
enum DEVICE_STATUS {
  '空闲' = 0,
  '使用' = 1
}
const _getScreenExaminationRoomTimesDeviceList=()=>{
  getScreenExaminationRoomTimesDeviceList().then(res => {
    if (res.code === 200) {
      gameList.value = res.data?.map((item:any)=>{
        return {
          ...item,
          sTime:dayjs(item.startTime).format('YYYY-MM-DD HH:mm'),
          eTime:dayjs(item.endTime).format('YYYY-MM-DD HH:mm')
        }
      })
    }
  })
}
onMounted(()=>{
  _getScreenDeviceInfo()
  _getScreenExaminationRoomTimesDeviceList()
})
</script>

<template>
<div class="ci-cont">
  <LogOut top="65px" right="60px" width="100px" height="100px" />
  <div class="ci-left">
    <div class="ci-tit">{{deviceInfo.name}}</div>
    <div class="ci-left_cont">
        <img :src="deviceInfo.image" alt="" />
    </div>
  </div>
  <div class="ci-right">
    <div class="ci-tit">比赛信息</div>
    <div class="ci-right_cont">
      <div class="ci-ul">
        <div class="ci-li ci-head_bg">
          考试场次
        </div>
        <div class="ci-li ci-head_bg">
          开始时间
        </div>
        <div class="ci-li ci-head_bg">
          结束时间
        </div>
<!--        <div class="ci-li ci-head_bg">-->
<!--          使用状态-->
<!--        </div>-->
      </div>
      <el-scrollbar height="1580">
        <div class="ci-ul" v-for="(item,index) in gameList" :key="index">
          <div class="ci-li ci-body_bg">
            {{item.name}}
          </div>
          <div class="ci-li ci-body_bg">
            {{item.startTime}}
          </div>
          <div class="ci-li ci-body_bg">
            {{item.endTime}}
          </div>
          <!--          <div class="ci-li ci-body_bg ci-li_text">-->
          <!--            {{DEVICE_STATUS[item.status]}}-->
          <!--          </div>-->
        </div>
      </el-scrollbar>
    </div>
  </div>
</div>
</template>

<style scoped lang="less">
.ci-cont{
  padding: 105px 81px 70px 98px;
  display: flex;
  width: 3840px;
  height: 2160px;
}

.ci-tit{
  font-family: AlimamaShuHeiTi;
  font-size: 60px;
  color: #fff;
  margin-bottom: 85px;
}
.ci-left{
  margin-right: 68px;
  .ci-left_cont{
    background: url("@/assets/fortyThree/ci-bg.png") no-repeat;
    width: 1640px;
    height: 1828px;
    padding: 80px 112px 56px 113px;
  }
    img{
      width: 100%;
      height: 100%;
    }
}

.ci-right_cont{
  width: 1951px;
  height: 1839px;
  background: rgba(11, 57, 133, 0.56);
  border-radius: 25px;
  border: 2px solid rgba(255,255,255,0.2);
  padding: 53px 37px 46px 61px;
}
.ci-ul{
  display: flex;
  align-items: center;
  .ci-li{
    width: 33%;
    height: 124px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    margin-bottom: 20px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 48px;
    color: #fff;
    font-style: normal;
    &.ci-li:last-child{
      margin-right: 0;
    }
  }
  .ci-head_bg{
    background: rgba(51,179,255,0.18);
    border: 2px solid #319BE7;
  }
  .ci-body_bg{
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.18);
  }
  .ci-li_text{
    color: #0DF4E8;
  }
}
</style>
